<%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
   pageEncoding="UTF-8"%>
   <%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="ssi.tools.Connector" %>
<%@ page import="ssi.beans.User" %>
   <h2>Edytuj Zwierzaka</h2>
   
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="js/jQuery.js"></script>
<script type="text/javascript" src="js/jquery.nivo.slider.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script type="text/javascript" src="js/calendar.js"></script>
<script type="text/javascript" src="js/animalChoice.js"></script>
<%
	Connection connection = new Connector().getConnection();
	Statement statement = connection.createStatement();
	ResultSet result = statement.executeQuery("SELECT * FROM animals");
	int numberOfRows = Connector.getRowCount(result);
%>

<html:form action="editAnimal" enctype="multipart/form-data">

<table>
<tr>
<td>Wybierz zwierzaka:</td>
<td>
<select name="id" id="id">
<option value="0">Wybierz... </option>
<%
int i=0;
while(result.next()){%>
<option value="<%=result.getString("id") %>"><%=result.getString("name")+" "+result.getString("breed") %></option>
<% 
} %>
</select>
</td>
</tr>
		
		<tr>
		<td><p>Data Urodzenia:</td> <td> <input type="text" name="birthDate" id="birthDate"/></td> 
		</tr>
		
		<tr>
		<td><p>Plec:</td> <td><select id="gender" name="gender"><option value="0">Wybierz... </option><option>Samiec</option><option>Samica</option></select></td>
		</tr>
		
		<tr>
		<td><p>Gatunek:</td> <td><input id="breed" name="breed" type="text" /></td> 
		</tr>
		
		<tr>
		<td><p>Imie:</td> <td><input id="name" name="name" type="text"/></td> 
		</tr>
		
		<tr>
		<td><p>Zdjecie:</td><td><html:file property="file" size="50" /></td> 
		</tr>
		</table> 
<input type="submit" class="submit" value="Zmien"/>
<font color="red"><html:errors property="info" /></font>


</html:form>
